/// <reference path="F:\Html5 Game\Game project\js\libs\kangax-fabric-48.306.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\DBAbstractionLayer.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\GameCanvas.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Node.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\NodeType.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Planet.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Region.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Scale.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\System.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Universe.js"/>
/// <reference path="F:\Html5 Game\Game project\js\classes\Utilities.js"/>
var Planet = function (name, coordinate, nodes) {

    //Verwijzingen
    var obj = this;
    var name = name;
    var coordinate = coordinate;
    var image = new Image();
    var nodes = nodes;

    //Variabelen

    //Constructor
    var _constructor = function () {
        image.src = "img/PLANETCONCEPT.png";
    }


    //Public functies
    obj.draw = function (context, scale) {
        try {
            if (scale == Scale.SYSTEM) {
                context.strokeStyle = "#000000";
                context.fillStyle = "#000000";
                context.beginPath();
                context.arc(coordinate.getX(), coordinate.getY(), 10, 0, Math.PI * 2, true);
                context.closePath();
                context.stroke();
            }
            if (scale == Scale.PLANET) {
                context.drawImage(image, 0, 0);
                for (node in nodes) {
                    nodes[node].draw(context, scale);
                }
            }
        }
        catch (e) {
        }
    }


    //Private Functies

    _constructor();
};